package com.chq.demo.controller;

import com.chq.demo.model.admin.user.UserModel;
import com.chq.demo.model.admin.user.UserQuery;
import com.chq.demo.model.common.BaseResponse;
import com.chq.demo.service.admin.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chenghongqiang
 * @date 2020-10-21 15:41
 * @since 1.0
 */
@Api(value = "用户管理", tags = "用户管理接口")
@RestController
@RequestMapping("/user")
public class UserController {

    @Reference
    private UserService userService;

    @ApiOperation("用户查询")
    @GetMapping("/list")
    public BaseResponse<List<UserModel>> list(UserQuery query) {
        List<UserModel> list = userService.list();
        return BaseResponse.ok(list);
    }

}
